Skip to content

Conversation

simolus3
Copy link
Contributor

@simolus3 simolus3 commented May 6, 2025

When download_core.js is invoked and a local copy of the core extension already exists, the script currently does nothing. That's fine when download_core.js is used as an install script because we expect that directory to be immutable after the install script ran.

Especially when developing on this SDK though, the current behavior can easily lead to situations where the core extension is outdated. This fixes the script to:

  1. Generate a sha256 hash for the local file if it exists.
  2. Compare that to the expected hash we carry for every core build the script may have to download.
  3. Only skip downloading the file if the hash matches.
  4. (there's also a post-download hash check now, you never know)

To be able to update the expected hashes after update, the script has an update_hashes subcommand that will print all hashes of the current version.

@simolus3 simolus3 requested a review from rkistner May 6, 2025 11:10
Copy link

changeset-bot bot commented May 6, 2025

⚠️ No Changeset found

Latest commit: 602cc30

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@simolus3 simolus3 merged commit b288aa1 into main May 6, 2025
6 checks passed
@simolus3 simolus3 deleted the fix-download-script branch May 6, 2025 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants